home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3847 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Function!...Function!
  5. Date: 31 Jan 1996 07:37 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <31JAN199607374132@erich.triumf.ca>
  9. References: <4emnfn$au5@ratree.psu.ac.th>
  10. NNTP-Posting-Host: erich.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4emnfn$au5@ratree.psu.ac.th>, s3610165@maliwan.psu.ac.th (Sanon CHAOCHAIYAPORN) writes...
  14. >Dear all
  15. >    Which function use to print a result of program to printer instead of 
  16. >monitor? Thanks for your help....:)
  17.  
  18. Depends on the operating system (and maybe compiler)
  19.  
  20. For MS-DOS, both Borland an Microsoft compilers automatically fopen the printer
  21. as "stdprn" when your program starts, so you can print simply by saying:
  22.  
  23. fprintf(stdprn, "the usual printf() stuff");
  24.  
  25. To switch the output between screen, printer and file, you can do:
  26.  
  27. FILE* output;
  28.  
  29. /* set output = stdout or stdprn or fopen a file  */
  30. fprintf(output, "as usual....");
  31.  
  32.  
  33.  
  34. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  35. Internet: bennett@triumf.ca         | of one another only when one can be
  36. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  37. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  38. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  39.  
  40.